<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>setAttribute</title>
    </head>
    <body>
        <input value="OK">

        <p id="demo">点击按钮来设置按钮的 type 属性。</p>

        <button onclick="myFunction()">试一下</button>
        <script src="setAttribute.js"></script>
    </body>
</html>